package com.liuhengjia.springaiapply.service;

import lombok.extern.slf4j.Slf4j;

import java.util.Random;
import java.util.function.Function;

/**
 * 模拟 OA 请假服务
 */
@Slf4j
public class OAService implements Function<OAService.Request, OAService.Response> {
    @Override
    public Response apply(Request key) {
        log.error("{} is taken off", key);
        return new Response(new Random().nextInt(8));
    }

    public record Request(String who) {

    }

    public record Response(int day) {

    }
}
